package com.yuyang.wifi.base;

import java.io.Serializable;

/**
 * Created by ttr01 on 2016/7/18.
 */

public class BaseResult implements Serializable {

    /*
     1000 成功
     2000 参数错误，可能是参数类型不对
     2001 必填参数为空
     2002 暂无数据
     3000 逻辑错误或系统异常，具体错误描叙信息参考message字段
     9000 userid参数不存在
     9001 appsign参数不存在
     9002 未登录或登录失效
     */

    private int count;
    private String msg;
    private int code;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isSuccess() {
        return getCode() == 0;
    }

    public String getErrorMessage() {
        return getMsg();
    }

    public int getResultCode() {
        return getCode();
    }


//    private BaseMessageModel message;
//
//    public BaseMessageModel getMessage() {
//        return message;
//    }
//
//    public void setMessage(BaseMessageModel message) {
//        this.message = message;
//    }

//    public boolean isSuccess() {
//        return getMessage().getReturnCode() == 0;
//    }

    public boolean isDataEmpty() {
        return getCode() == 2002;
    }

//    public String getErrorMessage() {
//        return getMessage().getReturnUserMessage();
//    }
//
//    public int getResultCode() {
//        return getMessage().getReturnCode();
//    }
}
